package comp9417;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by huy on 21/05/14.
 */
public class Attribute {
    public final String name;
    public final AttributeType type;
    public Map<String, Integer> categories = new HashMap<String, Integer>();
    public double min = 0.0;
    public double max = 0.0;
    public boolean prune = false;

    public Attribute(String name, AttributeType type) {
        this.name = name;
        this.type = type;
    }

    public void updateMinMax(double value) {
        if (value < min) min = value;
        if (value > max) max = value;
    }

    public double difference(Object v1, Object v2) {
        return type.difference(v1, v2, this);
    }

}
